import 'package:flutter/cupertino.dart';
import 'package:imember/Util/MyColor.dart';
import 'package:imember/Util/PageUtil.dart';
import 'package:imember/Widget/MyButton.dart';
import 'package:imember/Widget/MyInput.dart';

class InputFanDian extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
        width: 460,
        child: Column(mainAxisSize: MainAxisSize.min, children: [
          Container(
            height: 52,
            decoration: BoxDecoration(color: MyColor.Orange, borderRadius: BorderRadius.vertical(top: Radius.circular(8))),
            alignment: Alignment.center,
            child: Text("飯店", style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold, color: MyColor.White)),
          ),
          Container(
            height: 250,
              decoration: BoxDecoration(color: MyColor.White, borderRadius: BorderRadius.vertical(bottom: Radius.circular(8))),
              child:Column(
                children: [
                  Expanded(child: Input("飯店/ 民宿名稱")),
                  Container(color: MyColor.C9, height: 1, margin: EdgeInsets.fromLTRB(0, 12, 0, 12)),
                  Row(mainAxisAlignment: MainAxisAlignment.center, children: [
                    Button("取消", height: 28, width: 170, bgColor: MyColor.C99, radius: 14,onTap: (){
                      PageUtil().back(context);
                    }),
                    Container(width: 12),
                    Button("確認", height: 28, width: 170, bgColor: MyColor.Orange, radius: 14),
                  ]),
                  Container(height: 12),
                ],
              )
              )
        ]));
  }
}

class Input extends StatelessWidget {
  String title;

  String? inputType;
  TextEditingController? controller;

  Input(this.title, {this.inputType, this.controller});

  @override
  Widget build(BuildContext context) {
    return Row(mainAxisAlignment: MainAxisAlignment.center, children: [
      Text(title, style: TextStyle(fontSize: 12, color: MyColor.C70)),
      Container(
        decoration: BoxDecoration(
          borderRadius: BorderRadius.circular(15.0),
          border: Border.all(color: MyColor.C99, width: 1),
        ),
        height: 29,
        width: 243,
        margin: EdgeInsets.all(8),
        padding: EdgeInsets.fromLTRB(15, 0, 15, 0),
        child: NormalInput(fontSize: 14, inputType: inputType, controller: controller),
      )
    ]);
  }
}
